package com.gshg.log.cleanlog.quartz.JobDetail;

import com.gshg.log.cleanlog.service.LogCleanService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;

@Slf4j
public class LogFileCleanJobDetail extends QuartzJobBean {
    @Autowired
    LogCleanService logCleanService;
    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        log.info("LogFileCleanJobDetail runing......");
        try{
            logCleanService.cleanLogDeal();
        }catch (Exception e){
            log.error(e.getLocalizedMessage(), e);
        }
    }
}
